package com.zjfgz.lib_kt_com.base

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.xiasuhuei321.loadingdialog.view.LoadingDialog

abstract class BaseActivity : AppCompatActivity() {

    lateinit var ld : LoadingDialog

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        ld = LoadingDialog(this)
        ld.setLoadingText("加载中")
            .setSuccessText("加载成功")
            .setFailedText("加载失败")
            .setInterceptBack(false)
    }

    override fun onDestroy() {
        super.onDestroy()
            ld.close()
    }

    fun showWaitDialog(){
        ld.show()
    }

    fun hideWaitDialog(){
        ld.close()
    }
}